//
//  GSBaseViewController.m
//  GSDemo
//
//  Created by ZFJMAC on 2022/7/23.
//

#import "GSBaseViewController.h"

@interface GSBaseViewController ()

@end

@implementation GSBaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self baseViewConfig];
    // Do any additional setup after loading the view.
}

- (void)baseViewConfig{
    self.view.backgroundColor = GS_BG_COLOR;
    self.navigationController.navigationBar.titleTextAttributes = @{NSFontAttributeName:[UIFont systemFontOfSize:17], NSForegroundColorAttributeName:UIColor.blackColor};
    self.navigationController.navigationBar.translucent = NO;
    self.edgesForExtendedLayout = UIRectEdgeNone;
    if (@available(iOS 15.0, *)) {
        UINavigationBarAppearance *appperance = [[UINavigationBarAppearance alloc] init];
        appperance.backgroundColor = [UIColor colorWithHexString:@"#E9E8E6"];
        appperance.shadowImage = [[UIImage alloc]init];
        appperance.shadowColor = nil;
        [appperance setTitleTextAttributes:@{NSForegroundColorAttributeName:UIColor.blackColor,NSFontAttributeName:[UIFont systemFontOfSize:17]}];
        self.navigationController.navigationBar.standardAppearance = appperance;
        self.navigationController.navigationBar.scrollEdgeAppearance = appperance;
        self.navigationController.navigationBar.compactAppearance = appperance;
        self.navigationController.navigationBar.compactScrollEdgeAppearance = appperance;
    }
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    if (self.viewWillAppearNavigationBarHandler) {
        self.viewWillAppearNavigationBarHandler(animated);
    }else{
        [self.navigationController setNavigationBarHidden:NO animated:animated];
    }
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
